#import cherrypy
#import time
<!---------------------- NEW SPENT FORM -------------------------->
<div class="newSpentForm">
	<form name="newForm" action="/spent/insertSpent" method="POST">
		<table>
		<tr>
		<td><label for="categoryId">category</label></td>
		<td>
		<select name="categoryId">
			<option value="">category...</option>
			#for cat in $cherrypy.session['user'].categories:
				<option value="$cat.id">$cat.name</option>
			#end for
		</select>
		</td>
		</tr>
		<tr>
		<td><label for="paymentId">payment mode</label></td>
		<td>
		<select name="paymentId">
			<option value="">payment...</option>
			#for payment in $cherrypy.session['user'].payments:
				<option value="$payment.id">$payment.name</option>
			#end for
		</select>
		</td>
		</tr>
		<tr>
		<td><label for="date">date</label></td>
		<td>
		<INPUT TYPE="text" NAME="date" VALUE="$time.strftime('%Y-%m-%d')" SIZE=8 readonly="readonly">
		<a href="javascript:cal1.popup();"><img src="/static/images/x-office-calendar.png" 
			width="16" height="16" border="0" alt="Click Here to Pick up the date"></a>
		</td>
		</tr>
		<tr>
		<td><label for="value">value</label></td>
		<td><input type="text" name="value" size="5" value=""/></td>
		</tr>
		<tr>
		<td><label for="description">Description</label></td>
		<td><textarea name="description" cols="30" lines="3"></textarea></td>
		</tr>
		</table>
		<table>
		<hr/>
		<tr>
		<td><input type="submit" value="Insert"/></td>
		<td>
		<input type="reset" value="clear"/>
		</td>
		</tr>
		</table>
	</form>
	<script>
		var cal1 = new calendar3(document.forms['newForm'].elements['date']);
	</script>
</div>
<!-- END OF NEW SPENT FORM -->